s = '1a2b3c56ghjik'
for c in s:
    if c >= '0' and c <= '9':
        print(c,end=' ')
print()
s1 = ''
for c in s:
    if c >= 'a' and c <= 'z':
        s1 += c
        print(c,end=' ')
print('\n',s1.upper())